﻿(function () {
    window.onload = function () {

        // Creating a map
        var options = {
            zoom: 5,
            center: new google.maps.LatLng(36.6, -118.1),
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById('map'), options);

        // Creating an array with the points for the polygon
        var points = [
            new google.maps.LatLng(37.7671, -122.4206),
            new google.maps.LatLng(34.0485, -118.2568),
            new google.maps.LatLng(36.129002, -115.173218),
            new google.maps.LatLng(33.478418, -112.079988),
            new google.maps.LatLng(39.763158, -104.989686)
        ];

        // Creating the polygon
        var polygon = new google.maps.Polygon({
            paths: points,
            map: map,
            strokeColor: '#ff0000',
            strokeOpacity: 0.6,
            strokeWeight: 1,
            fillColor: '#008000',
            fillOpacity: 0.35
        });

    };

})();